﻿using System;
using System.Windows;
using System.Windows.Input;

namespace TFSTools.TestManagement.TestCaseReview
{
    public class WaitCursorHelper : IDisposable
    {
        private FrameworkElement parentElement;
        private Cursor lastCursor;

        public WaitCursorHelper(FrameworkElement parent)
        {
            this.parentElement = parent;

            this.lastCursor = this.parentElement.Cursor;
            this.parentElement.Cursor = Cursors.Wait;
        }

        public void Dispose()
        {
            this.parentElement.Cursor = this.lastCursor;
        }
    }
}
